'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.get('/', controller.home.index);
  //登录
  router.post('/api/login', controller.login.login);
  //获取数据
  router.post('/api/lists', controller.home.getList);
  //详情页
  router.post('/api/detail', controller.home.detail);
  //添加关注
  router.put('/api/addcar', controller.home.addcar);
  //渲染关注别表
  router.post('/api/addlists', controller.home.addlists);
  //添加题目
  router.post('/api/quiz', controller.home.quiz);

  //预约
  router.post('api/book', controller.home.book);
  //预约渲染
  router.post('/api/books', controller.home.books);
  //渲染添加后的题目
  router.post('/api/quize', controller.home.quize);
  //删除题目
  router.delete('/api/del', controller.home.del);
  //通过姓名搜索
  router.post('/api/search', controller.home.search);
  //通过word搜索
  router.post('/api/searchs', controller.home.searchs);
  //删除
  router.delete('/api/delet', controller.home.delete);

  //关注页详情
  router.post('/api/details', controller.home.details);

  //描点数据
  router.get('/api/list', controller.home.det);

  //筛选
  router.post('/api/area', controller.home.area);
  router.post('/api/area2', controller.home.area2);
  router.post('/api/area3', controller.home.area3);

  //关注列表删除
  router.delete('/api/watchdel', controller.home.watchdel);
};
